home *** CD-ROM | disk | FTP | other *** search
/ VRML Browsing & Building Cyberspace / VRML - Browsing and Building Cyberspace.iso / examples / ninetnth.wrl < prev    next >
Text File  |  1995-06-14  |  1KB  |  52 lines

  1. #VRML V1.0 ascii
  2.  
  3. # Example nineteen - using the LOD level-of-detail node
  4. # Doesn't really do anything practical, but demonstrates LOD
  5.  
  6. DEF LOD_EXAMPLE Separator {
  7.  
  8.     # This is a simple example
  9.     # The LOD node groups everything within it together
  10.     DEF LOD_NODE LOD  {
  11.         range [ 50,100 ]
  12.  
  13.         # If closer than 50 units, the Sun is yellow
  14.         DEF CloseIn Separator {
  15.  
  16.             # The sun is yellow, isn't it?
  17.             Material {
  18.                 emissiveColor 1 1 0        # MFColor
  19.             }
  20.             Sphere {
  21.                 radius 10        # Big Sun
  22.             }
  23.         }
  24.  
  25.         # If closer than 100 units, but greater than 50 units, the Sun is a magenta Cone
  26.         DEF Medium Separator {
  27.  
  28.             # The sun is magenta, isn't it?
  29.             Material {
  30.                 emissiveColor 1 0 1        # MFColor
  31.             }
  32.             Cone {
  33.                 bottomRadius 10    # Conical Sun
  34.                 height 10
  35.             }
  36.         }
  37.  
  38.         # If further away than 100 units, the Sun is a white Cube
  39.         DEF FarAway Separator {
  40.  
  41.             # The sun is white, isn't it?
  42.             Material {
  43.                 emissiveColor 1 1 1        # MFColor
  44.             }
  45.             Cube {
  46.                 width 10        # Cube Sun
  47.                 height 10
  48.                 depth 10
  49.             }
  50.         }
  51.     }
  52. }